import * as echarts from 'echarts';
export const provincialSlopeInformationData = () => {
  return {
    data: [
      { city: "百色", number: "15" },
      { city: "桂林", number: "13" },
      { city: "南宁", number: "10" },
      { city: "梧州", number: "9" }
    ],
    color: [
      "rgb( 39,  71, 128, 1)",
      "rgb( 22, 132, 199, 1)"
    ]
  }


}

export const deviceStatisticsData = () => {
  return {
    chartData: [
      {
        value: 520,
        name: "智能环",
      },
      {
        value: 280,
        name: "摄像头",
      },
      {
        value: 100,
        name: "太阳能板",
      },
    ],
    colorList: [
      new echarts.graphic.LinearGradient(0, 0, 0, 1, [
        {
          offset: 0,
          color: "#f8ffff",
        },
        {
          offset: 1,
          color: "#f8ffff99",
        },
      ]),
      new echarts.graphic.LinearGradient(0, 0, 0, 1, [
        {
          offset: 0,
          color: "#43b7db",
        },
        {
          offset: 1,
          color: "#43b7db99",
        },
      ]),
      new echarts.graphic.LinearGradient(0, 0, 0, 1, [
        {
          offset: 0,
          color: "#d47f1f",
        },
        {
          offset: 1,
          color: "#d47f1f99",
        },
      ]),
    ]
  }
}

export const areaDeviceStatisticsData = () => {
  return [
    {
      code: "MG1",
      area: "桂林",
      number: "30",
      online: "28",
      offline: "2",
      alar: "1",
      time: "01/12 16：35"
    },
    {
      code: "CE1",
      area: "桂林",
      number: "11",
      online: "10",
      offline: "1",
      alar: "1",
      time: "01/12 16：35"
    },
    {
      code: "MG2",
      area: "桂林",
      number: "30",
      online: "28",
      offline: "2",
      alar: "1",
      time: "01/12 16：35"
    },
    {
      code: "MG3",
      area: "桂林",
      number: "30",
      online: "28",
      offline: "2",
      alar: "1",
      time: "01/12 16：35"
    },
    {
      code: "MG4",
      area: "桂林",
      number: "30",
      online: "28",
      offline: "2",
      alar: "1",
      time: "01/12 16：35"
    },
    {
      code: "MG5",
      area: "桂林",
      number: "30",
      online: "28",
      offline: "2",
      alar: "1",
      time: "01/12 16：35"
    },
  ]
}

export const alarStatisticsData = () => {
  return {
    chartData: [
      {
        value: 3,
        name: "应力不足",
      },
      {
        value: 3,
        name: "电压过低",
      },
      {
        value: 1,
        name: "位移告警",
      },
    ],
    colorList: [
      new echarts.graphic.LinearGradient(0, 0, 0, 1, [
        {
          offset: 0,
          color: "#f8ffff",
        },
        {
          offset: 1,
          color: "#f8ffff99",
        },
      ]),
      new echarts.graphic.LinearGradient(0, 0, 0, 1, [
        {
          offset: 0,
          color: "#43b7db",
        },
        {
          offset: 1,
          color: "#43b7db99",
        },
      ]),
      new echarts.graphic.LinearGradient(0, 0, 0, 1, [
        {
          offset: 0,
          color: "#d47f1f",
        },
        {
          offset: 1,
          color: "#d47f1f99",
        },
      ]),
    ]
  }
}

/**
 * 风险top5
 * @returns 风险top5数据
 */
export const riskTop5Data = () => {
  return {
    data: [
      { city: "西林", number: "13" },
      { city: "隆林", number: "11" },
      { city: "上林", number: "8" },
      { city: "龙川", number: "7" },
      { city: "崇左", number: "6" }
    ],
    color: [
      "rgb( 116, 128,  39)",
      "rgb( 199,  46,  22)"
    ]
  }
}



/**
 * 地图
 */
export const mapData = () => {
  return [
    {
      name: '全省',
      code: "45",
      coordinate: [108.320004, 22.82402],
      isCity: 1
    }, {
      name: '南宁市',
      code: "4501",
      coordinate: [108.320004, 22.82402],
      isCity: 1
    }, {
      name: '柳州市',
      code: "4502",
      coordinate: [109.411703, 24.314617],
      isCity: 1
    }, {
      name: '桂林市',
      code: "4503",
      coordinate: [110.299121, 25.274215],
      isCity: 1
    }, {
      name: '梧州市',
      code: "4504",
      coordinate: [111.297604, 23.474803],
      isCity: 1
    }, {
      name: '北海市',
      code: "4505",
      coordinate: [109.119254, 21.473343],
      isCity: 1
    }, {
      name: '防城港市',
      code: "4506",
      coordinate: [108.345478, 21.614631],
      isCity: 1
    }, {
      name: '钦州市',
      code: "4507",
      coordinate: [108.624175, 21.967127],
      isCity: 1
    }, {
      name: '贵港市',
      code: "4508",
      coordinate: [109.602146, 23.0936],
      isCity: 1
    }, {
      name: '玉林市',
      code: "4509",
      coordinate: [110.154393, 22.63136],
      isCity: 1
    }, {
      name: '百色市',
      code: "4510",
      coordinate: [106.616285, 23.897742],
      isCity: 1
    }, {
      name: '贺州市',
      code: "4511",
      coordinate: [111.552056, 24.414141],
      isCity: 1
    }, {
      name: '河池市',
      code: "4512",
      coordinate: [108.062105, 24.695899],
      isCity: 1
    }, {
      name: '来宾市',
      code: "4513",
      coordinate: [109.229772, 23.733766],
      isCity: 1
    }, {
      name: '崇左市',
      code: "4514",
      coordinate: [107.353926, 22.404108],
      isCity: 1
    }
  ];
}


/**
 * 区域列表
 * @returns
 */
export const areaData = (param = '') => {
  const area = [
    { name: '广西柳州市融水县良寨乡滑坡体检监测', value: [109.097095, 25.569803], isCity: 0, father: "4502" },
    { name: '广西百色市西林县弄工屯滑坡体检监测', value: [105.181886, 24.531837], isCity: 0, father: "4510" },
    { name: '广西百色市田林县旧州镇滑坡体检监测', value: [105.472393, 24.5286], isCity: 0, father: "4510" },
    { name: '广西百色市隆林县坝那塘屯滑坡体检监测', value: [105.472393, 24.5286], isCity: 0, father: "4510" },
    { name: '广西百色市平果市巴平路边坡体检监测', value: [107.526855, 23.830857], isCity: 0, father: "4510" },
    { name: '广西百色市隆林县塘房屯滑坡体检监测', value: [105.272248, 24.789683], isCity: 0, father: "4510" },
    { name: '广西百色市隆林县码头屯滑坡体检监测', value: [105.25772, 24.936286], isCity: 0, father: "4510" },
    { name: '广西合那高速化峒停车场边坡体检监测', value: [106.470777, 23.04806], isCity: 0, father: "4510" },
    { name: '广西桂林市永福县胜利村滑坡体检监测', value: [110.080525, 24.808106], isCity: 0, father: "4503" },
    { name: '广西全州石塘夏蓉高速边坡体检监测', value: [110.999439, 25.732869], isCity: 0, father: "4503" },
    { name: '桂林市建筑沉降体检监测', value: [110.294292, 25.279113], isCity: 0, father: "4503" }
  ]

  let areaD = area.filter(i => i.father.includes(param))

  return areaD
}


